/**
{
  path: "", // 路径
  name: "", // 名称
  // 路由使用name跳转时使用
  // 组件中使用 attr.query | attr.params
  props: (route: any) => ({query: route.query, params: route.params }),
  component: () => import("@/views/index.vue"), // 组件
  meta: {
    title: "项目列表", // 标题
    index: 1, // 表示几级页面，1:一级; 2:二级; 以此类推
    auth: true, // 鉴权
    useNavHeader: true, // 需要标题栏，否则false
    useToolbar: true, // 需要工具栏，否则false
  }
}
*/

import { createRouter, createWebHashHistory } from 'vue-router'

export const routes = [{
  path: '/login',
  component: () => import('@/views/login/index.vue'),
  meta: { title: '登录' },
},
{
  path: '/home',
  component: () => import('@/views/home/index.vue'),
  meta: { title: '首页', useToolbar: true },
},
{
  path: '/projects',
  component: () => import('@/views/projects/index.vue'),
  meta: { title: '项目列表', useToolbar: true },
},
{
  path: '/user',
  component: () => import('@/views/user/index.vue'),
  meta: { title: '用户中心', useToolbar: true },
},
]

export const routerPaths = {
  login: '/login',
  home: '/home',
  projects: '/projects',
  user: '/user',
}

const router = createRouter({
  history: createWebHashHistory(),
  routes,
})

export default router